home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / develop / libsrc11.arc / WRBYTSPI.C < prev    next >
C/C++ Source or Header  |  1989-04-27  |  671b  |  34 lines

  1. /*    wrbytspi.c 4.3        */
  2. /*F****************************************************************************
  3.  
  4. FUNCTION NAME:    wrbytspi
  5.  
  6. ACTION:        Writes a byte to the SPI port.
  7.  
  8. PARAMETERS:
  9.         byte_value:    value to be written to SPI port
  10.  
  11. RETURNS:    (void)
  12.  
  13. ******************************************************************************/
  14.  
  15. #include <hc11/io.h>
  16. #include <hc11/spi.h>
  17. #include <hc11/directives.h>
  18.  
  19. SMALL
  20. void wrbytspi(byte_value)
  21.  
  22.     int    byte_value;
  23.  
  24.     {
  25.  
  26.     HC11.SPCR |= SPE;
  27.  
  28.     HC11.SPSRDAT.DATAREG = byte_value;
  29.  
  30.     while ((HC11.SPSRDAT.STATUS & SPIF) == 0)    /* wait for byte to be output */
  31.         ;    /* null statement */
  32.  
  33.     }    /* end of wrbytspi    */
  34.